﻿using CoreCms.Net.Model.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CoreCms.Net.Model.ViewModels.YiLianYun
{
    /// <summary>
    /// 易联云全局配置
    /// </summary>
    public static class YiLianYunConfig
    {
        /// <summary>
        /// 授权相关地址
        /// </summary>
        public const string AuthUrl = "https://open-api.10ss.net/oauth/oauth";

        /// <summary>
        /// 获取终端状态地址

        /// </summary>

        public const string GetPrintStatusUrl = "https://open-api.10ss.net/printer/getprintstatus";

        /// <summary>
        /// 文本打印地址
        /// </summary>

        public const string PrintTextUrl = "https://open-api.10ss.net/print/index";

        /// <summary>
        /// 小票打印模板
        /// </summary>
        public static StringBuilder PrintTmpModel(CoreCmsOrder listResult)
        {
            var printStr = new StringBuilder();
            printStr.Append("<center>--" + "支付" + "订单--</center>\r");
            printStr.Append("................................\r");
            printStr.Append("<center>-- -</center>\r");
            printStr.Append("下单时间：" + listResult.createTime + "\r");
            printStr.Append("订单编号：" + listResult.orderId + "\r");
            printStr.Append("**************商品**************\r");
            printStr.Append("<center>--购买明细--</center>\r");

            //printStr.Append("<center>--其他消费--</center>\r");
            //printStr.Append("餐盒 1 2\r");
            printStr.Append("................................\r");
            printStr.Append("积分抵扣：￥" + listResult.pointMoney + "\r");
            printStr.Append("订单优惠：￥" + listResult.orderDiscountAmount + "\r");
            printStr.Append("商品优惠：￥" + listResult.goodsDiscountAmount + "\r");
            printStr.Append("优惠券：￥" + listResult.couponDiscountAmount + "\r");
            printStr.Append("总价：￥" + listResult.orderAmount + "\r");
            printStr.Append("*******************************\r");
            printStr.Append("区域：" + listResult.shipAreaName + "\r");
            printStr.Append("地址：" + listResult.shipAddress + "\r");
            printStr.Append("联系：" + listResult.shipName + " " + listResult.shipMobile + "\r");
            printStr.Append("***************完结*************\r");
            return printStr;
        }

    }



}
